package exam.axhu.action;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.Interceptor;

import exam.axhu.entity.Student;

public class StudentLoginFilter  implements Interceptor {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public void destroy() {
	
	}

	public void init() {
	
	}

	public String intercept(ActionInvocation invocation) throws Exception {
		Student student =(Student) ActionContext.getContext().getSession().get("studentInfo");
		if(student!=null) return invocation.invoke();
		ActionContext.getContext().put("message", "您没有登录");
		return "notLogin";
	}
}
